package org.yzl.designPatterns.builder;

import org.yzl.designPatterns.builder.impl.MailSenderImpl;
import org.yzl.designPatterns.builder.impl.MessageSenderImpl;

import java.util.ArrayList;
import java.util.List;

public class Builder {

    public List<ISender> getList() {
        return list;
    }

    public void setList(List<ISender> list) {
        this.list = list;
    }

    private List<ISender> list = new ArrayList<ISender>();

    public void produceMailSender(int count){
        for(int i=0; i<count; i++){
            list.add(new MailSenderImpl());
        }
    }

    public void produceSmsSender(int count){
        for(int i=0; i<count; i++){
            list.add(new MessageSenderImpl());
        }
    }
}

